<template>
    <router-link
        :to="routeHomePath"
        class="flex items-center w-full nowrap-hidden padding pl-10px"
    >
        <jb-icon v-show="showIcon" :local-icon="logo" class="text-40px"></jb-icon>
        <h2
            v-show="showTitle"
            class="pl-8px text-22px font-bold text-primary transition duration-300 ease-in-out"
        >
            {{ appName }}
        </h2>
    </router-link>
</template>

<script setup lang="ts">
import { routePath } from '@/router'

defineOptions({ name: 'GlobalLogo' })

interface Props {
    /** 显示名字 */
    showTitle: boolean
    showIcon: boolean
}

defineProps<Props>()

const appName = import.meta.env.VITE_APP_NAME
const logo = import.meta.env.VITE_APP_LOGO
const routeHomePath = routePath('root')
</script>

<style scoped></style>
